#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "dialog.h"
#include <QDialog>
#include <QPushButton>

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
}

MainWindow::~MainWindow()
{
    delete ui;
}


void MainWindow::on_pushButton_clicked()
{
//    QDialog *dialog = new QDialog(this);
//    dialog->setWindowTitle("不是对话框");
//    dialog->resize(500,200);

//    dialog->setAttribute(Qt::WA_DeleteOnClose);

//    dialog->show();

    Dialog *dialog = new Dialog(this);
    dialog->setWindowTitle("不是对话框");
    dialog->resize(500,200);

    dialog->setAttribute(Qt::WA_DeleteOnClose);

    dialog->show();
}
